import random


class ShuangSeQiu:
    def __init__(self, shadan_red=[], shadan_blue=[], dingd_red=[], dingd_blue=[]):
        self.c = {}
        self.d = {}
        for key1 in range(1, 34):
            self.c[key1] = 0
        for key2 in range(1, 17):
            self.d[key2] = 0
        self.a = list(range(1, 34))
        self.b = list(range(1, 17))
        self.shadan_red = shadan_red
        self.shadan_blue = shadan_blue
        self.dingd_red = dingd_red
        self.dingd_blue = dingd_blue
        self.len1 = 0

    def shadingdan(self):

        # 杀胆

        for i in self.shadan_red:
            self.a.remove(i)
        for i in self.shadan_blue:
            self.b.remove(i)

        # 定胆

        for i in self.dingd_red:
            self.a.remove(i)
        self.len1 = len(self.dingd_red)

    def xuanhao(self):

        # 机选
        for i in range(5):
            # 机选6个红球
            red_ball = random.sample(self.a, 6 - self.len1)
            red_ball.extend(self.dingd_red)
            red_ball.sort()
            for j in red_ball:
                self.c[j] += 1

            # 机选1个蓝球
            if len(self.dingd_blue) != 0:
                self.b = self.dingd_blue
            blue_ball = random.sample(self.b, 1)
            self.d[blue_ball[0]] += 1

            # 输出机选号码
            red_ball.append(blue_ball)
            ball = red_ball[:]
            print(ball)
        print()

    def tongji(self):
        print(self.c)
        print(self.d)


shuangseqiu = ShuangSeQiu()
shuangseqiu.xuanhao()
shuangseqiu.xuanhao()
shuangseqiu.tongji()
